#pragma once
#include <vector>
#include <so_math.h>
#include <Timer.hpp>
#include <Data.h>
#include <IVisible.h>
enum class Anchor{
    Center,
    Left,
    Right,
    Top,
    Bottom
};

class IAnimation : public IVisible
{
private:
    std::vector<Image *> frames_list;
    std::vector<real> intervaltime_list;
    int index = 0;
    bool isPaused = false;
    Timer timer;
    int loopCount = 0;
    Anchor anchor;
public:
    IAnimation(Vector2 renderSize,Vector2 offset);
    ~IAnimation() = default;
    void addFrame(Image *frame, real intervaltime);
    void update(real delta);
    void start(int index = 0,int loopCount = 0);
    void pause(bool val);
    bool paused();
    void setAnchor(Anchor val);
    Anchor getAnchor();
};